 const loginServes = require('../serves/loginServes')
 
 const loginController = {
  login:async(req,res) => {
    const {username,password} = req.body
    console.log(username,password)
    const data = await loginServes.login(username,password)
    if(data.length === 0) {
      res.send({ok:0})
    } else {
      // 设置session
      req.session.user = data[0]
      res.send({ok:1})
    }
  }
 }



 module.exports = loginController